<template>
  <view class="smart-container">
    <view class="smart-panel-title">1. 容器</view>
    <view class="smart-panel-h" @click="goDetailPage('view')">view 视图</view>
    <view class="smart-panel-h" @click="goDetailPage('scroll-view')">scroll-view 滚动视图</view>
    <view class="smart-panel-h" @click="goDetailPage('swiper')">swiper 可滑动视图</view>

    <view class="smart-panel-title">2. 基础内容</view>
    <view class="smart-panel-h" @click="goDetailPage('text')">text 文本</view>
    <view class="smart-panel-h" @click="goDetailPage('rich-text')">rich-text 富文本</view>
    <view class="smart-panel-h" @click="goDetailPage('progress')">progress 进度条</view>

    <view class="smart-panel-title">3. 表单组件</view>
    <view class="smart-panel-h" @click="goDetailPage('button')">button 按钮</view>
    <view class="smart-panel-h" @click="goDetailPage('radio')">radio 单选框</view>
    <view class="smart-panel-h" @click="goDetailPage('checkbox')">checkbox 多选框</view>
    <view class="smart-panel-h" @click="goDetailPage('input')">input 输入控件</view>
    <view class="smart-panel-h" @click="goDetailPage('picker')">picker 选择列表</view>
    <view class="smart-panel-h" @click="goDetailPage('slider')">slider 滑块</view>
    <view class="smart-panel-h" @click="goDetailPage('switch')">switch 开关</view>
    <view class="smart-panel-h" @click="goDetailPage('textarea')">textarea 多行文本输入</view>
    <view class="smart-panel-h" @click="goDetailPage('form')">form 表单</view>

    <view class="smart-panel-title">4. 导航</view>
    <view class="smart-panel-h" @click="goDetailPage('navigator')">navigator 导航</view>

    <view class="goto-login-btn">
      <button type="primary" @click="gotoLogin">跳转到登录页</button>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    goDetailPage(type) {
      console.log(`即将前往 ${type} 相关页面`);
    },
    gotoLogin() {
      uni.navigateTo({
        url: "/pages/login/index"
      });
    }
  }
};
</script>

<style>
.smart-container {
  padding: 10px;
  background-color: #f9f9f9;
}
.smart-panel-title {
  font-size: 16px;
  font-weight: bold;
  margin: 10px 0;
  color: #5d4037;
  padding-left: 5px;
  border-left: 3px solid #8d6e63;
}
.smart-panel-h {
  margin: 5px 0;
  padding: 10px 5px;
  background-color: #efebe9;
  border-radius: 4px;
  color: #4e342e;
  transition: background-color 0.2s;
}
.smart-panel-h:active {
  background-color: #d7ccc8;
}
.goto-login-btn {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
.goto-login-btn button {
  background-color: #6d4c41;
  border-color: #6d4c41;
}
</style>
    